#pragma once

#include "DecafLangBaseVisitor.h" // Generated Base Visitor
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Value.h"
#include <any> // For returning values like llvm::Value* from visit methods
#include <map> // Example: for a simple symbol table

// Use the generated namespace
namespace decaf_lang::parser {

    class ASTVisitor : public DecafLangBaseVisitor {
        llvm::LLVMContext& context;
        llvm::Module& module;
        llvm::IRBuilder<>& builder;

        std::map<std::string, llvm::Value*> intVars;
        std::map<std::string, llvm::Value*> stringVars;


    public:
        ASTVisitor(llvm::LLVMContext& ctx, llvm::Module& mod, llvm::IRBuilder<>& bld)
            : context(ctx), module(mod), builder(bld) {}
        std::any visitDecl(DecafLangParser::DeclContext *ctx) override;
        std::any visitPrintStmt(DecafLangParser::PrintStmtContext *ctx) override;
        std::any visitProgram(DecafLangParser::ProgramContext *ctx) override;
        std::any visitAssign(DecafLangParser::AssignContext *ctx) override;

    };

} // namespace decaf_lang::parser
